package com.shenhaofeng.app.loader.list;


/**
 * Created by Administrator on 2016/9/30.
 */
public class Pager {


    private int mPageSize;

    private int mPage;

    private int mFirstPage;


    public Pager(int firstPage, int pageSize) {
        this.mPageSize = pageSize;
        this.mFirstPage = firstPage;
    }


    public int getFirstPage() {
        return mFirstPage;
    }


    /**
     * 获取每页的数据大小
     *
     * @return
     */
    public int getPageSize() {
        return mPageSize;
    }


    /**
     * 获取当前页
     *
     * @return
     */
    public int getPage() {
        return mPage;
    }


    /**
     * 下一页
     *
     * @return
     */
    public int nextPage() {
        mPage++;
        return mPage;
    }


    /**
     * 检查下一页
     *
     * @return
     */
    public int peekNextPage() {
        return mPage + 1;
    }


    /**
     * 重置
     *
     * @return
     */
    public int reset() {
        mPage = mFirstPage;
        return mPage;
    }
}
